package nbcp.base.utils

import org.springframework.web.context.request.RequestContextHolder
import java.util.concurrent.Executors

/**
 * Created by udi on 17-5-27.
 */

//Single Instance Object
object sio {
    private val threadPool = Executors.newWorkStealingPool();

    fun execute(act:(()->Unit)){
        var ra = RequestContextHolder.getRequestAttributes();
        threadPool.execute {
            RequestContextHolder.setRequestAttributes(ra);
            act();
        }
    }
}